<template>
	<view>
		<view class="tabs">
			<view class="tab">
				<u-tabs active-color="#F3060D" :list="tabList" :is-scroll="false" :current="current" @change="change"></u-tabs>
			</view>
			<view class="toTag" @click="toPath('/pages/tags/tags')">
				<u-icon name="tags-fill" size="42"></u-icon>
			</view>
		</view>
		<scroll-view class="list" scroll-y >
			<view class="item" v-for="(item, index) in list" :key="index" @click="toPath('/pages/user/detail')">
				<view class="img">
					<image class="img" :src="ip+item.avatar" mode=""></image>
				</view>
				<view class="info">
					<view class="nickname">
						{{item.nickname}}
					</view>
					<view class="binfo">
						<view class="phone gray">
							手机号：{{item.phone}}
						</view>
						<view class="id gray">
							ID：12312312312(没有)
						</view>
					</view>
				</view>
				<view class="tag">
					{{item.tags.data.title}}
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabList: [
					{
						name: '用户列表'
					},
					{
						name: '黑名单列表'
					}
				],
				current: 0,
				list:{}
			}
		},
		methods: {
			getList() {
				
				this.$api.request({
					url: 'orders',
					method: 'GET',
					data: {
						is_black:0
						
					}
				}).then(res => {
					console.log('res', res);
					if (res.code == 200) {
						this.list=res.data;
					}
				}).catch(err => {
					console.error(error);
				});
			},
			change(index) {
				this.current = index;
			},
			toPath(path) {
				uni.navigateTo({
					url: path
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.tabs {
		position: relative;
		background-color: #FFF;
		display: flex;
		align-items: center;
		justify-content: center;
		.tab {
			width: 70%;
		}
		.toTag {
			position: absolute;
			right: 20rpx;
			top: 19rpx;
		}
	}
	.list {
		padding: 20rpx 20rpx;
		height: calc(100vh - 82rpx);
		box-sizing: border-box;
		.item {
			padding: 20rpx;
			background-color: #FFF;
			border-radius: 10rpx;
			display: flex;
			margin-bottom: 20rpx;
			position: relative;
			.tag {
				width: 120rpx;
				height: 36rpx;
				position: absolute;
				right: 0;
				top: 0;
				border-radius: 10rpx 0rpx 10rpx 0rpx;
				background-color: #F3060D;
				font-size: 20rpx;
				color: #FFFFFF;
				font-weight: 500;
				display: flex;
				align-items: center;
				justify-content: center			}
			.info {
				display: flex;
				justify-content: space-between;
				flex-direction: column;
				.id {
					margin-top: 8rpx;
				}
				.gray {
					font-weight: 500;
					font-size: 24rpx;
					color: #999999;
				}
				.nickname {
					font-weight: 700;
					font-size: 30rpx;
					color: #1E1E1E;
				}
			}
			.img {
				width: 140rpx;
				height: 140rpx;
				border-radius: 10rpx;
				margin-right: 20rpx;
			}
		}
	}
</style>

<style>
	page {
		background-color: #F4F5F7;
	}
</style>